#pragma once

#include <QObject>
#include <QPointer>
#include <QColor>
#include <QVector3D>

#include <osg/ref_ptr>
#include <osgGA/GUIEventHandler>

#include "Qt3DPicker.h"

class CmdManager;
namespace osg
{
	class Camera;
}
class QtOSGWidget;
class HighlightObjectUnderMouse : public osgGA::GUIEventHandler
{
public:
	HighlightObjectUnderMouse(CmdManager *cmdManager, QtOSGWidget *widget3D);
	~HighlightObjectUnderMouse();

	virtual bool handle(const osgGA::GUIEventAdapter &ea, osgGA::GUIActionAdapter &aa);

private:
	QPointer<CmdManager> m_cmdManager;
	osg::ref_ptr<Qt3DPicker> m_picker;
	osg::ref_ptr<osg::Geometry> m_hightlight;
	std::weak_ptr<INode> m_lastNode;
	std::vector<std::vector<osg::Vec3d>> m_edgePoints;
};
